package com.a01_2021.thousandstimes.general.mapper;

import com.a01_2021.thousandstimes.general.entity.Experience;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author FRQ
 * @since 2021-02-22
 */
public interface ExperienceMapper extends BaseMapper<Experience> {

    @Insert("<script>" +
            "INSERT INTO experience (user_id, start_date, end_date, post_id, title, instance_id, score) VALUES " +
            "<foreach collection='list' index='index' item='item' separator=','>" +
            "(#{item.user_id},#{item.start_date},#{item.end_date},#{item.post_id},#{item.title},#{item.instance_id},#{item.score})" +
            "</foreach>" +
            "</script>")
    void addList(List<Experience> experienceList);
}
